import java.util.concurrent.Executor;import java.util.concurrent.Executors;import java.util.concurrent.ScheduledExecutorService;import java.util.concurrent.TimeUnit;/** * Created by Administrator on 2018-11-29. */public class ScheduledAtFixedRateTest {    public static void main(String[] args) {        ScheduledExecutorService ses = Executors.newScheduledThreadPool(2);        ses.scheduleAtFixedRate(new Runnable() {            @Override            public void run() {                try{                    Thread.sleep(1000);                    System.out.println(System.currentTimeMillis()/1000+"Thread id"+ Thread.currentThread().getId() );                } catch (InterruptedException e) {                    e.printStackTrace();                }            }        },0,1,TimeUnit.SECONDS);    }}